package com.hjl.config;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.*;

/**
 * @author ServivE
 * @version 0.1
 * @className WebJavaConfig
 * @description
 * @date 2024/8/13 20:29
 * @since jdk17
 */
@Configuration
@ComponentScan(basePackages = {"com.hjl.controller"})
@EnableWebMvc
public class WebJavaConfig implements WebMvcConfigurer {
    //开启静态资源
    @Override
    public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
        configurer.enable();
    }

    //视图解析器
    @Override
    public void configureViewResolvers(ViewResolverRegistry registry) {
        registry.jsp("/WEB-INF/views/", ".jsp");
    }

    //拦截器
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(new xxx);
    }
}
